package com.link2room.quintesson.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by sss on 2017/4/6.
 */
@Entity
@Table(name = "taobao_shotel")
@DynamicInsert
public class TaobaoShotel extends BaseEntity{
    private String outerHid;
    private Long hid;
    private String shotel;

    @Basic
    @Column(name = "outer_hid", nullable = false, length = 32)
    public String getOuterHid() {
        return outerHid;
    }

    public void setOuterHid(String outerHid) {
        this.outerHid = outerHid;
    }

    @Basic
    @Column(name = "hid", nullable = true)
    public Long getHid() {
        return hid;
    }

    public void setHid(Long hid) {
        this.hid = hid;
    }

    @Basic
    @Column(name = "shotel", nullable = true, length = -1)
    public String getShotel() {
        return shotel;
    }

    public void setShotel(String shotel) {
        this.shotel = shotel;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TaobaoShotel that = (TaobaoShotel) o;

        if (outerHid != null ? !outerHid.equals(that.outerHid) : that.outerHid != null) return false;
        if (hid != null ? !hid.equals(that.hid) : that.hid != null) return false;
        return shotel != null ? shotel.equals(that.shotel) : that.shotel == null;

    }

    @Override
    public int hashCode() {
        int result = outerHid != null ? outerHid.hashCode() : 0;
        result = 31 * result + (hid != null ? hid.hashCode() : 0);
        result = 31 * result + (shotel != null ? shotel.hashCode() : 0);
        return result;
    }
}
